package com.jgp.attachment.service;

import com.jgp.attachment.exception.DocException;
import com.jgp.attachment.model.FileInfo;
import com.jgp.attachment.model.MountObject;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.List;

/**
 * 项目   parent
 * 作者   loufei
 * 时间   2018/4/28
 */
public interface DocService {
    FileInfo upload(MultipartFile file, HttpServletRequest request) throws DocException;
    
    FileInfo uploadEditorImage(MultipartFile file, HttpServletRequest request) throws DocException;
    
    FileInfo queryByMd5(String md5);
    
    List<MountObject> queryMountFiles(String objectId, String objectType);
    
    List<MountObject> queryMountFiles(String fileId);
    
    List<MountObject> createMountFiles(List<MountObject> mountObjects);
    
    long updateMountFiles(List<MountObject> mountObjects);
    
    long countMountFiles(String fileId);
    
    FileInfo queryFile(String fileId);
    
    File queryIOFile(String fileId);
    
    List<FileInfo> queryFiles(List<String> fileIds);
    
    List<FileInfo> queryFiles(String objectId, String objectType);
    
    void mountFilesToObject(String objectId, String objectType, String ... fileIds);
    
    List<File> queryIOFiles(List<String> fileIds);
    
    List<File> queryIOFiles(String objectId, String objectType);
    
    void removeFile(String objectId, String objectType, String fileId);
}
